<template>
  <el-menu
      :default-active="1"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
  >
    <el-menu-item index="1" @click="toCreate" v-if="user !== null && user.urole !== 1">我组织的</el-menu-item>
    <el-menu-item index="2" @click="toJoin">我参加的</el-menu-item>
  </el-menu>
  <router-view></router-view>

</template>

<script>
export default {
  name: "UserVolunte",
  data() {
    return {
      user: {},
    }
  },
  mounted() {
    this.user = JSON.parse(localStorage.getItem("user"))
    console.log(this.user)
  },
  methods: {
    toCreate() {
      this.$router.push("/front/userInfo/UserVolunte/mycreate")
    },

    toJoin() {
      this.$router.push("/front/userInfo/UserVolunte/myjoin")
    }
  }
}
</script>

<style>

</style>